13. Exercise: Mockito Verify
Mockito Verify
Test ChargeService
Task Description:
The starter project for this exercise provides a class called ChargeService
that has a single method chargeUser
. The chargeUser method takes a userId and some purchase information and then it calculates how much to charge the user. Finally it sends the charge request to a charge user http client.
Your task is to write a test for the chargeUser
method that verifies the correct amount is charged to a user. To do this, you'll need to create a mock http client, build a list of test data to charge the user for, and then verify that the correct value was sent to the mock client.
Task Feedback:
Great job!